;--------------------------------------
;
; restScrn.asm
;
; restScrn(int *buffer)
;
; int *buffer  previously saved screen image
;
; restores the screen to buffer
;
;--------------------------------------
;
; include defs, prototypes and macros
;

include tab6.inc

;--------------------------------------
;
; begin code segment
;

    .Code

restScrn PROC Pascal PUBLIC USES es di ds si, buffer:PWord

; ds:si points to source string
; es gets screen segment

IF mdl eq 3
    mov    ax,SEG scrn_seg
    mov    ds,ax
    mov    ax,ds:scrn_seg
    mov    es,ax
    sub    di,di
    lds    si,buffer
    
ELSE
    mov    ax,scrn_seg
    mov    es,ax
    sub    di,di
    mov    si,buffer
ENDIF

; relocate 2000 screen token to buffer

    cld
    mov    cx,2000
    rep    movsw
    ret
restScrn ENDP

    END
;
;--------------------------------------
    
    

